package com.xypower.tree;

//折纸，对折N次，求从上往下折纸方向
public class PaperFolding {
    public static void printAllFolds(int N){
        printProcess(1,N,true);
    }

    //中序遍历方式打印，只使用了N个空间
    private static void printProcess(int i, int N, boolean down) {
        if (i > N){
            return;
        }
        printProcess(i+1,N,true);
        System.out.println(down ? "凹" : "凸");
        printProcess(i+1,N,false);
    }

    public static void main(String[] args) {
        int N = 3;
        printAllFolds(N);
    }
}
